package com.draven.order.controller.page;

import com.draven.model.product.ProductDTO;
import com.draven.order.service.OrderService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("/page")
public class PageController {

    @GetMapping("/home")
    public String home() {
        return "home";
    }

    @GetMapping("/orders")
    public String orders() {
        return "order";
    }

    @GetMapping("/products")
    public String products() {
        return "product";
    }

    @GetMapping("/members")
    public String members() {
        return "member";
    }

    @GetMapping("/order_create")
    public String orderCreate() {
        return "order_create";
    }

    @RequestMapping("/product/detail")
    public String productDetail() {
        return "product_detail";
    }

    @RequestMapping("/product/detail/{id}")
    public String productDetail(@PathVariable Long id) {
        return "product_detail";
    }

    @RequestMapping("/order_confirmation/{id}")
    public String orderConfirmation(@PathVariable Long id) {
        return "order_confirmation";
    }

    @RequestMapping("/cart")
    public String productCart() {
        return "cart";
    }
}